home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / AIFF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  4.1 KB  |  231 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Monday, December 2, 1991 at 5:00 PM
  5.  AIFF.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1990-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __AIFF__
  16. #define __AIFF__
  17.  
  18. #ifndef __TYPES__
  19. #include <Types.h>
  20. #endif
  21.  
  22.  
  23. enum {
  24.  
  25.  
  26. #define AIFFID 'AIFF'
  27. #define AIFCID 'AIFC'
  28. #define FormatVersionID 'FVER'
  29. #define CommonID 'COMM'
  30. #define FORMID 'FORM'
  31. #define SoundDataID 'SSND'
  32. #define MarkerID 'MARK'
  33. #define InstrumentID 'INST'
  34. #define MIDIDataID 'MIDI'
  35. #define AudioRecordingID 'AESD'
  36. #define ApplicationSpecificID 'APPL'
  37. #define CommentID 'COMT'
  38. #define NameID 'NAME'
  39. #define AuthorID 'AUTH'
  40. #define CopyrightID '(c) '
  41. #define AnnotationID 'ANNO'
  42.  
  43.  NoLooping = 0,
  44.  ForwardLooping = 1,
  45.  ForwardBackwardLooping = 2,
  46.  
  47. /* AIFF-C Versions */
  48.  AIFCVersion1 = 0xA2805140
  49.  
  50. /* Compression Names */
  51.  
  52. #define NoneName "\pnot compressed"
  53. #define ACE2to1Name "\pACE 2-to-1"
  54. #define ACE8to3Name "\pACE 8-to-3"
  55. #define MACE3to1Name "\pMACE 3-to-1"
  56. #define MACE6to1Name "\pMACE 6-to-1"
  57.  
  58. /* Compression Types */
  59. #define NoneType 'NONE'
  60. #define ACE2Type 'ACE2'
  61. #define ACE8Type 'ACE8'
  62. #define MACE3Type 'MAC3'
  63. #define MACE6Type 'MAC6'
  64. };
  65.  
  66. typedef unsigned long ID;
  67. typedef short MarkerIdType;
  68.  
  69. struct ChunkHeader {
  70.  ID ckID;
  71.  long ckSize;
  72. };
  73.  
  74. typedef struct ChunkHeader ChunkHeader;
  75.  
  76. struct ContainerChunk {
  77.  ID ckID;
  78.  long ckSize;
  79.  ID formType;
  80. };
  81.  
  82. typedef struct ContainerChunk ContainerChunk;
  83.  
  84. struct FormatVersionChunk {
  85.  ID ckID;
  86.  long ckSize;
  87.  unsigned long timestamp;
  88. };
  89.  
  90. typedef struct FormatVersionChunk FormatVersionChunk;
  91. typedef FormatVersionChunk *FormatVersionChunkPtr;
  92.  
  93. struct CommonChunk {
  94.  ID ckID;
  95.  long ckSize;
  96.  short numChannels;
  97.  unsigned long numSampleFrames;
  98.  short sampleSize;
  99.  extended80 sampleRate;
  100. };
  101.  
  102. typedef struct CommonChunk CommonChunk;
  103. typedef CommonChunk *CommonChunkPtr;
  104.  
  105. struct ExtCommonChunk {
  106.  ID ckID;
  107.  long ckSize;
  108.  short numChannels;
  109.  unsigned long numSampleFrames;
  110.  short sampleSize;
  111.  extended80 sampleRate;
  112.  ID compressionType;
  113.  char compressionName[1];
  114. };
  115.  
  116. typedef struct ExtCommonChunk ExtCommonChunk;
  117. typedef ExtCommonChunk *ExtCommonChunkPtr;
  118.  
  119. struct SoundDataChunk {
  120.  ID ckID;
  121.  long ckSize;
  122.  unsigned long offset;
  123.  unsigned long blockSize;
  124. };
  125.  
  126. typedef struct SoundDataChunk SoundDataChunk;
  127. typedef SoundDataChunk *SoundDataChunkPtr;
  128.  
  129. struct Marker {
  130.  MarkerIdType id;
  131.  unsigned long position;
  132.  Str255 markerName;
  133. };
  134.  
  135. typedef struct Marker Marker;
  136.  
  137. struct MarkerChunk {
  138.  ID ckID;
  139.  long ckSize;
  140.  unsigned short numMarkers;
  141.  Marker Markers[1];
  142. };
  143.  
  144. typedef struct MarkerChunk MarkerChunk;
  145. typedef MarkerChunk *MarkerChunkPtr;
  146.  
  147. struct AIFFLoop {
  148.  short playMode;
  149.  MarkerIdType beginLoop;
  150.  MarkerIdType endLoop;
  151. };
  152.  
  153. typedef struct AIFFLoop AIFFLoop;
  154.  
  155. struct InstrumentChunk {
  156.  ID ckID;
  157.  long ckSize;
  158.  char baseFrequency;
  159.  char detune;
  160.  char lowFrequency;
  161.  char highFrequency;
  162.  char lowVelocity;
  163.  char highVelocity;
  164.  short gain;
  165.  AIFFLoop sustainLoop;
  166.  AIFFLoop releaseLoop;
  167. };
  168.  
  169. typedef struct InstrumentChunk InstrumentChunk;
  170. typedef InstrumentChunk *InstrumentChunkPtr;
  171.  
  172. struct MIDIDataChunk {
  173.  ID ckID;
  174.  long ckSize;
  175.  unsigned char MIDIdata[1];
  176. };
  177.  
  178. typedef struct MIDIDataChunk MIDIDataChunk;
  179. typedef MIDIDataChunk *MIDIDataChunkPtr;
  180.  
  181. struct AudioRecordingChunk {
  182.  ID ckID;
  183.  long ckSize;
  184.  unsigned char AESChannelStatus[24];
  185. };
  186.  
  187. typedef struct AudioRecordingChunk AudioRecordingChunk;
  188. typedef AudioRecordingChunk *AudioRecordingChunkPtr;
  189.  
  190. struct ApplicationSpecificChunk {
  191.  ID ckID;
  192.  long ckSize;
  193.  OSType applicationSignature;
  194.  char data[1];
  195. };
  196.  
  197. typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
  198. typedef ApplicationSpecificChunk *ApplicationSpecificChunkPtr;
  199.  
  200. struct Comment {
  201.  unsigned long timeStamp;
  202.  MarkerIdType marker;
  203.  unsigned short count;
  204.  char text[1];
  205. };
  206.  
  207. typedef struct Comment Comment;
  208.  
  209. struct CommentsChunk {
  210.  ID ckID;
  211.  long ckSize;
  212.  unsigned short numComments;
  213.  Comment comments[1];
  214. };
  215.  
  216. typedef struct CommentsChunk CommentsChunk;
  217. typedef CommentsChunk *CommentsChunkPtr;
  218.  
  219. struct TextChunk {
  220.  ID ckID;
  221.  long ckSize;
  222.  char text[1];
  223. };
  224.  
  225. typedef struct TextChunk TextChunk;
  226. typedef TextChunk *TextChunkPtr;
  227.  
  228.  
  229.  
  230. #endif
  231.